#ifndef __MAINFRAMEWND_H__
#define __MAINFRAMEWND_H__

#include <ShellAPI.h>
#include "ConfigMgr.h"
#include "OptionDetailsFrame.h"

class CExamination;
class CMainFrameWnd : public WindowImplBase
{
public:
	CMainFrameWnd(CDuiString strXMLPath);
	~CMainFrameWnd();

protected:
	virtual CDuiString	GetSkinFolder();
	virtual CDuiString	GetSkinFile();
	virtual LPCTSTR		GetWindowClassName(void) const;

	virtual void		Notify(TNotifyUI& msg);
	virtual void		InitWindow();

	virtual LRESULT		OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	virtual LRESULT		HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
	virtual LRESULT		MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
	virtual LRESULT		OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

public:
	BOOL SetTrayIcon();
	BOOL ShowOptionItems();
	BOOL AddListItem(LPCTSTR lpItemText, LPCTSTR lpRegistryKey, BOOL bShowDesc = TRUE);
	BOOL GetOptionValueInRegistry(LPCTSTR lpOptionKey);
	BOOL SetOptionValue(LPCTSTR lpRegistryKey);
	BOOL ShowOptionDetails(LPCTSTR lpRegistryKey);
	LRESULT OnTrayIcon(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled);
	CDuiString GetFileVersion(LPCTSTR FileName);
	VOID UpdateVersionInfo();
	BOOL UpdateIconInStatusBar();

private:
	CDuiString				m_strXMLPath;
	CButtonUI*				m_pAccelerateBtn;
	CButtonUI*				m_pCleanBtn;
	CButtonUI*				m_pSettingsBtn;
	CLabelUI*				m_pNotice;
	CDialogBuilder			m_dlgItemBuilder;
	CDuiString				m_strCurrentTab;
	NOTIFYICONDATA			m_nid;
	CListUI*				m_pListUI;

	COptionDetailsFrame*	m_pDetailsFrame;

	CConfigMgr&				m_config;
};

#endif
